package cn.wolfcode.luowowo.article.mapper;

import cn.wolfcode.luowowo.article.domain.StrategyDetail;
import cn.wolfcode.luowowo.common.query.QueryObject;
import cn.wolfcode.luowowo.common.query.TravelQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyDetail record);

    StrategyDetail selectByPrimaryKey(Long id);

    List<StrategyDetail> selectAll();

    List<StrategyDetail> selectForList(QueryObject qo);

    int updateByPrimaryKey(StrategyDetail record);

    void deleteRelation(Long detailId);

    void insertRelation(@Param("detailId") Long detailId,
                        @Param("tagId") Long tagId);

    List<StrategyDetail> selectByDestId(Long destId);

    List<StrategyDetail> selectByCatalogId(Long catalogId);

    List<StrategyDetail> listViewNumTop3(Long id);

    /**
     * 持久化热数据
     * @param detail
     */
    void updateStats(StrategyDetail detail);

    List<StrategyDetail> listByUserFavor(TravelQueryObject qo);
}